package com.slz3.business.module.drawManagement.draGoods.steward;

import com.slz3.business.module.drawManagement.draGoods.domain.DraGoods;
import com.slz3.business.module.drawManagement.draGoods.domain.DraGoodsCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class DraGoodsResponse {

    public static Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(DraGoods.class).flatMap(draGoods ->
                DraGoodsResController.add(req, draGoods)
        );
    }

    public static Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(DraGoodsCondition.class).flatMap(draGoodsCondition ->
                DraGoodsResController.delete(req, draGoodsCondition)
        );
    }

    public static Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(DraGoods.class).flatMap(draGoods ->
                DraGoodsResController.modify(req, draGoods)
        );
    }


    public static Mono<ServerResponse> list(ServerRequest req) {
        return DraGoodsResController.list(req);
    }

    public static Mono<ServerResponse> info(ServerRequest req) {
        return DraGoodsResController.info(req);
    }

    public static Mono<ServerResponse> choice(ServerRequest req) {
        return DraGoodsResController.choice(req);
    }

    public static Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(DraGoodsCondition.class).flatMap(draGoodsCondition ->
                DraGoodsResController.auditSubmit(req, draGoodsCondition)
        );
    }

    public static Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(DraGoodsCondition.class).flatMap(draGoodsCondition ->
                DraGoodsResController.audit(req, draGoodsCondition)
        );
    }

    public static Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(DraGoodsCondition.class).flatMap(draGoodsCondition ->
                DraGoodsResController.auditReject(req, draGoodsCondition)
        );
    }

    public static Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(DraGoodsCondition.class).flatMap(draGoodsCondition ->
                DraGoodsResController.usingEnable(req, draGoodsCondition)
        );
    }

    public static Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(DraGoodsCondition.class).flatMap(draGoodsCondition ->
                DraGoodsResController.usingDisable(req, draGoodsCondition)
        );
    }   

}
